local vTimeWaited = 0

function ccR_AutoJoinLFG()
	if not LFGAutoJoin then LFGAutoJoin = CreateFrame("Frame") end
	LFGAutoJoin:SetScript("OnUpdate", AJ_OnUpdate)
	LFGAutoJoin:SetScript("OnEvent", AJ_OnEvent)
	LFGAutoJoin:RegisterEvent("LFG_PROPOSAL_SHOW")
end

function AJ_OnEvent(self, event, arg1)
	if event == "LFG_PROPOSAL_SHOW" then
		AcceptProposal();
	end
end

function AJ_OnUpdate(self, elapsed)
	vTimeWaited = vTimeWaited + 1
	if vTimeWaited > 100 then
		LFGAutoJoin:RegisterEvent("LFG_PROPOSAL_SHOW")
		vTimeWaited = 0
	end
end